home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / emacs16d.zip / MINTED.MIN < prev    next >
Text File  |  1991-09-02  |  25KB  |  1,291 lines

  1.  
  2.  
  3. M-x ef of M
  4.  
  5. Name:Mfilename
  6. I included Jost Kreiger's cref and trace packages in the minted library.
  7. -russ
  8.  
  9. Russ, I got your letter a bit late because of a typo in my name,
  10. so here I hurry the text of the cross-reference thing. Unfortunately,
  11. I forgot all about it in the meantime, as it was not really useful because
  12. of memory problems. It turned out to be in no good shape at all, so I reworked
  13. it a bit. MINT debugging is not easy, so I also remembered a rudimentray trace
  14. tool I wrote at the same time. It comes in the same text.
  15.  
  16. Here it comes with a few remarks:
  17.  
  18. 1. There were a few loose ends. I need sole left and right parentheses,
  19.    to pass them to a function (wait, what did I do then ...). These are
  20.    given names here instead of recalculating them every time. (I put this
  21.    in M&setup in the meantime.) I don't know if this is a general problem.
  22.    [ I changed it to use ##(bc,40,d,a) and ##(bc,41,d,a) -russ]
  23.  
  24. 2. The trace-functions are everything else but smart, and they slow down
  25.    interpretation very much (if you trace, e.g., Fmultiple-do). I find them
  26.    helpful, though. Problems:
  27. The trace buffer overflows rapidly with unfortunate side-effects.
  28. You may never, never forget to untrace everything before saving.
  29. (In this version the original text is part of the traced one, though.)
  30. The indentation tends to get messed up very often.
  31.    In effect, its more of an idea than a facility. Everything is possible,
  32.    but most things will make it slower.
  33.  
  34. 3. I called everything D: to make it part of a "DEVELOP" library.
  35.    Thats easy to change, of course.  [I put it in minted -russ]
  36.  
  37. The probably obsolete contents of my comments file for you to check:
  38.  Fset-mode-by-ext sets spell mode, although the speller is not installed.
  39.  In Freadline, you can edit the old text with backspace (feature ?).
  40.  The x command always suggests x as a command.
  41.  
  42. I hope this can be of use
  43.  
  44. Jost Krieger
  45.  
  46. P.S.:
  47. Please contact me under the nonmnemonical name "P920031@DBORUB01" in BITNET,
  48. thats safest and our mailer doesn't mess up the incoming messages any more.
  49. [*]minted[*]
  50.  
  51.  
  52. Name:F!M:byte-compile-file
  53. [*][*]
  54.  
  55.  
  56. Name:F!M:edit-options
  57. [*][*]
  58.  
  59.  
  60. Name:F!M:ef
  61. [*][*]
  62.  
  63.  
  64. Name:F!M:ek
  65. [*][*]
  66.  
  67.  
  68. Name:F!M:eval-expression
  69. [*][*]
  70.  
  71.  
  72. Name:F!M:eval-last-sexp
  73. [*][*]
  74.  
  75.  
  76. Name:F!M:keys-edit
  77. [*][*]
  78.  
  79.  
  80. Name:F!M:mint-grep
  81. [*][*]
  82.  
  83.  
  84. Name:F:Mint-mode
  85. This will set the local mode to mint-mode.  The code is contained in the
  86. M library.
  87. [*]#(M!Mint-mode)[*]
  88.  
  89.  
  90. Name:F:mint-mode
  91. [*]#(F:Mint-mode)[*]
  92.  
  93.  
  94. Name:M!Mint-mode
  95. Enter Mint mode.
  96. [*]#(Fexit-mode)
  97. #(ds,d,##(gs,Mint-cmd,#(Farglist)))
  98. #(mp,d,#(Farglist))
  99. #(ds,local-mode-changes,##(local-mode-changes)(
  100.     #(ds,d,##(gs,Fcmd,#(Farglist)))
  101.     #(mp,d,#(Farglist))
  102. ))
  103. #(Flocal-bind-key,open-paren-hook,(
  104.     #(==,##(rm,<),#,(
  105.         ##(sp,<)
  106.         #(==,##(rm,<),#,(
  107.             ##(sp,<)
  108.         ))
  109.     ))
  110. ))
  111. #(Fset-modename,Mint)
  112. #(ds,syntax,##(Fsyntax))
  113. #(Fmodify-syntax,syntax,##(bc,_),0)
  114. #(Fmodify-syntax,syntax,##(bc,-),1)
  115. #(Fmodify-syntax,syntax,##(bc,!),1)
  116. #(Fmodify-syntax,syntax,##(bc,:),1)
  117. #(Fmodify-syntax,syntax,##(bc,.),1)
  118. #(st,syntax)
  119. [*]
  120.  
  121.  
  122. Name:M:Options-help
  123. [*]
  124. #(ow,(
  125. n    Next option.
  126. p    Previous option.
  127. s    Set an option.
  128. ?    Show help message.
  129. ))
  130. #(Fhit-any-key)
  131. [*]
  132.  
  133.  
  134. Name:M:Options-mode
  135. [*]#(Fexit-mode)
  136. #(Flocal-bind-key,K.n,M:Options-next)
  137. #(Flocal-bind-key,K.p,M:Options-prev)
  138. #(Flocal-bind-key,K.s,M:Options-set)
  139. #(Flocal-bind-key,K.q,M:Options-quit)
  140. #(Flocal-bind-key,K.?,M:Options-help)
  141. #(Fmv,Fself-insert,F!self-insert)
  142. #(Fmv,MOptions-insert,Fself-insert)
  143. #(ds,local-mode-changes,##(local-mode-changes)(
  144.     #(Fmv,Fself-insert,MOptions-insert)
  145.     #(Fmv,F!self-insert,Fself-insert)
  146. ))
  147. #(Fset-modename,Options)
  148. [*]
  149.  
  150.  
  151. Name:M:Options-next
  152. [*]#(pm,1)
  153. #(lp,N    a    m    e:)
  154. #(l?,>,],0,,(
  155.     #(Fset-new-mark,.)
  156.     #(sp,0)
  157. ),(
  158.     #(an,End of buffer)
  159. ))
  160. #(pm)
  161. [*]
  162.  
  163.  
  164. Name:M:Options-prev
  165. [*]#(pm,1)
  166. #(lp,N    a    m    e:)
  167. #(l?,.,[,0,,(
  168.     #(Fset-new-mark,.)
  169.     #(sp,0)
  170. ),(
  171.     #(an,Beginning of buffer)
  172. ))
  173. #(pm)
  174. [*]
  175.  
  176.  
  177. Name:M:Options-quit
  178. [*]#(Freturn-to-buffer)[*]
  179.  
  180.  
  181. Name:M:Options-set
  182. [*]#(ds,value,
  183.     #(pm,3)
  184.     #(lp,#(Mstrings-delimiter))
  185.     #(l?,.,],,1,(
  186.         #(l?,1,],2,,(
  187.             #(sp,1)
  188.             ##(rm,2)
  189.         ))
  190.     ))
  191.     #(sp,0)
  192.     #(pm)
  193. )
  194. #(ds,option,
  195.     #(pm,1)
  196.     #(lp,N    a    m    e:)
  197.     #(l?,.,],,0,(
  198.         #(sp,0)
  199.         ##(rm,$)
  200.     ))
  201.     #(pm)
  202.     #(sp,^)
  203. )
  204. #(Freadline,Set ##(option): ,(
  205.     #(ds,##(option),##(value))
  206.     #(ds,##(go,option)modified)
  207.     #(Fset-variables)
  208.     #(pm,3)
  209.     #(lp,#(Mstrings-delimiter))
  210.     #(l?,.,],,1,(
  211.         #(l?,1,],2,,(
  212.             #(sp,1)
  213.             #(dm,2)
  214.             #(is,##(value))
  215.         ))
  216.     ))
  217.     #(sp,0)
  218.     #(pm)
  219. ))
  220. #(es,option)
  221. [*]
  222.  
  223.  
  224. Name:M:check-parens
  225. [*]#(lp,^N    a    m    e:arg1$,,r)
  226. #(l?,[,],,0,(
  227.     #(an,arg1 is already loaded)
  228. ),(
  229.     #(SELF-do,arg1)
  230. ))[*]
  231.  
  232.  
  233. Name:M:compare-ed
  234. Read a .ED file.  Convert the file into an EDIT type file, preserving
  235. only those functions that DIFFER from the current ones.  This is very
  236. useful for making diffs between the currently loaded .ED files and
  237. other .ED files.
  238. [*]#(sp,[)
  239. #(is,(
  240.  
  241. All of the functions below are different in the .ed file.  The version from
  242. the .ed file appears after the trailing )#(Mstrings-delimiter)(old:
  243.  
  244. ))
  245. #(Mcompare-read,(
  246.     #(ds,compare-ed-list,##(ls,(,),##(data)))
  247.     #(Mcompare-ed-do)
  248. ))
  249. #(is,(
  250.  
  251. All of the functions below are not in the .ed file
  252.  
  253. ))
  254. #(Fmultiple,Mstrings-edit-do-do,##(gs,compare-ed-list)#(es,compare-ed-list))
  255. [*]
  256.  
  257.  
  258. Name:M:copy-key
  259. Copy one key definition to another.
  260. [*]#(Mcopy-key-do,
  261.     #(an,Enter Source key?)
  262.     #(Fget-key-with-prefixes)
  263. ,
  264.     #(an,Enter Destination key?)
  265.     #(Fget-key-with-prefixes)
  266.     #(an)
  267. )
  268. [*]
  269.  
  270.  
  271. Name:M:count-parens
  272. [*]#(Finsist,(arg1),SELF,(
  273.     #(Muse-edit-buffer)
  274.     #(es,temp)
  275.     #(ds,temp,##(sa,##(ls,(,),arg1)))
  276.     #(mp,temp,(Farglist,))
  277.     #(Fmultiple,Mcount-parens-do,##(gs,temp)#(es,temp),SELF)
  278. ))[*]
  279.  
  280.  
  281. Name:M:cref-all
  282. Generate a buffer named *cref* containing a cross reference of all
  283. defined strings. Each used string is listed on a new line, followed by an
  284. asterisk if it is defined anywhere, and then followed by lines filled with
  285. the names of functions that reference it.
  286. [*]#(Ffind-or-make-buffer,*cref*)
  287. #(ds,temp,##(sa,#(Ffor-all-libs,Mcref-lib-do)))
  288. #(mp,temp,(,))
  289. #(is,##(gs,temp,(
  290. )))
  291. #(Mcref-post)
  292. [*]
  293.  
  294.  
  295. Name:M:cref-lib
  296. Generate a buffer called *cref* containing a cross reference of all
  297. strings used in a library. A prompt is issued for the library letter.
  298. Each used string is listed on a new line, followed by an asterisk if it
  299. is defined in the library, and then followed by lines filled with
  300. the names of functions in the library that reference it.
  301. [*]#(ds,value,)
  302. #(Freadline,lib letter: ,(
  303.     #(Ffind-or-make-buffer,*cref*)
  304.     #(ds,temp,##(sa,#(Fmultiple,Mcref-lib-do,##(value)(,),SELF)))
  305.     #(mp,temp,(,))
  306.     #(is,##(gs,temp,(
  307. )))
  308.     #(Mcref-post)
  309. ))[*]
  310.  
  311.  
  312. Name:M:done-editing
  313. Reads strings from the current buffer.
  314. [*]#(pm,1)
  315. #(sm,0)
  316. #(sp,[)
  317. #(Fexit-mode)
  318. #(Mstrings-read)
  319. #(Fenter-local-modes)
  320. #(sp,[)
  321. #(Flooking-at,\[\*\],(
  322.     #(sp,>>>)
  323.     #(lp,#(Mstrings-delimiter))
  324.     #(l?,.,],0,,(
  325.         #(ow,##(rm,0))
  326.         #(ow,(
  327. -----))
  328.         #(Fy-or-n,Execute this MINT code (y/n)?,(
  329.             #(==,ARG1,y,(
  330.                 #(rm,0)
  331.             ))
  332.         ))
  333.     ))
  334. ))
  335. #(Fbuffer-has-fn,,(
  336.     #(sv,mb,0)
  337. ))
  338. #(sp,0)
  339. #(pm)
  340. [*]
  341.  
  342.  
  343. Name:M:edit-options
  344. [*]#(Muse-edit-buffer)
  345. #(is,(Type 'q' when finished.  '?' for help.
  346. ))
  347. #(M:strings-edit,
  348.     #(Flist-all-strings,-)
  349. )
  350. #(M:Options-mode)
  351. #(sp,[)
  352. #(rd)
  353. #(M:Options-next)
  354. [*]
  355.  
  356.  
  357. Name:M:ef
  358. [*]#(Finsist,(arg1),SELF,(
  359.     #(Muse-edit-buffer)
  360.     #(sv,mb,##(lv,mb),
  361.         #(Fcrlf)
  362.         #(Fset-new-mark,<)
  363.         #(Fcrlf)
  364.         #(is,M-x ef of arg1)
  365.         #(Fcrlf)
  366.     )
  367.     #(M:strings-edit,
  368.         ##(ls,(,),arg1)
  369.         #(Flist-all-strings,arg1)
  370.         #(Flist-all-strings,:arg1)
  371.         #(Flist-all-strings,!arg1)
  372.     )
  373.     #(F:swap-point-and-mark)
  374. ))[*]
  375.  
  376.  
  377. Name:M:ek
  378. Edit a key definition and it's assocated function.
  379. [*]#(==,arg1,,(
  380.     #(an,Enter key to edit?)
  381.     #(SELF,#(Fget-key-with-prefixes),#(an))
  382. ),(
  383.     #(n?,K.arg1,(
  384.         #(Muse-edit-buffer)
  385.         #(sv,mb,##(lv,mb),
  386.             #(Fcrlf)
  387.             #(Fset-new-mark,<)
  388.             #(Fcrlf)
  389.             #(is,M-x ek of arg1)
  390.             #(Fcrlf)
  391.         )
  392.         #(M:strings-edit,(K.arg1,)##(K.arg1))
  393.     ),(
  394.         #(Fmessage,arg1 not defined)
  395.     ))
  396. ))[*]
  397.  
  398.  
  399. Name:M:erase-string
  400. Erase the string named by arg1.
  401. [*]#(Finsist,(arg1),SELF,(
  402.     #(es,arg1)
  403.     #(ds,temp,arg1)
  404.     #(ds,##(go,temp)modified)
  405. ))[*]
  406.  
  407.  
  408. Name:M:eval-expression
  409. Execute a primitive.
  410. [*]#(ds,value,##(old-x))
  411. #(Freadline,eval-expression:,(
  412.     #(ds,old-x,##(value))
  413.     #(an,#(value))
  414. ))[*]
  415.  
  416.  
  417. Name:M:eval-last-sexp
  418. Evaluate the MINT expression before point.
  419. [*]    
  420. #(pm,1)
  421. #(Fbackward-find-paren,[,(##(bc,40,d,a)),(##(bc,41,d,a)))
  422. #(==,##(rm,<),#,(
  423.     ##(sp,<)
  424.     #(==,##(rm,<),#,(
  425.         ##(sp,<)
  426.     ))
  427. ))
  428. #(==,arg1,,(
  429.     #(an,#(rm,0)#(sp,0))
  430. ),(
  431.     #(is,#(rm,0)#(sp,0))
  432. ))
  433. #(pm)
  434. [*]
  435.  
  436.  
  437. Name:M:give-name
  438. Insert a null string definition.
  439. [*]#(Finsist,(arg1),SELF,(
  440.     #(Muse-edit-buffer)
  441.     #(is,(
  442.  
  443.  
  444. )
  445.         N    a    m    e:(arg1)
  446.         (
  447. )
  448.         #(Mstrings-delimiter)
  449.         #(Mstrings-delimiter)
  450.     )
  451. ))
  452. [*]
  453.  
  454.  
  455. Name:M:insert-brackets
  456. [*]#(is,#(Mstrings-delimiter))[*]
  457.  
  458.  
  459. Name:M:insert-name
  460. [*]#(Fcrlf)
  461. #(Fcrlf)
  462. #(Fcrlf)
  463. #(sp,<<)
  464. #(is,#(Mstrings-delimiter))
  465. #(is,#(Mstrings-delimiter))
  466. #(sp,^)
  467. #(is,Name:)
  468. #(Fcrlf)
  469. #(sp,<)
  470. [*]
  471.  
  472.  
  473. Name:M:keys-edit
  474. [*]#(Fremember-buffer)
  475. #(Ffind-or-make-buffer,*keys-edit*,n)
  476. #(Fmultiple,Mkeys-edit-do,##(sa,#(ls,(,),K.)),SELF)
  477. #(sp,[)[*]
  478.  
  479.  
  480. Name:M:keys-read
  481. Read the keymap inserted by #(M:keys-edit)
  482. [*]#(sp,[)
  483. #(ds,Kmodified)
  484. #(es,#(ls,(,),K.))
  485. #(Mkeys-read-do,0)[*]
  486.  
  487.  
  488. Name:M:mint-expand
  489. Expand the MINT word to the left of point as much as possible.
  490. [*]#(==,##(rc,{),0,(
  491.     #(Fmessage,Nothing to complete)
  492. ),(
  493.     #(ds,completing-set,(##(ls,(,),##(rm,{))))
  494.     #(ds,value,##(rm,{))
  495.     #(ds,readline-msg)
  496.     #(ds,2nd-half)
  497.     #(Fcompleting-readline.C-i)
  498.     #(dm,{)#(is,##(value))
  499.     #(==,##(readline-msg),,,(
  500.         #(Fmessage,##(rm,{)##(readline-msg))
  501.     ))
  502. ))
  503. [*]
  504.  
  505.  
  506. Name:M:mint-grep
  507. #(M:mint-grep) will edit all strings containing STRING
  508. [*]#(Freadline,M-x ##(value)#(ds,value) ,(
  509.     #(Muse-edit-buffer)
  510.     #(sv,mb,##(lv,mb),
  511.         #(Fcrlf)
  512.         #(Fset-new-mark,<)
  513.         #(Fcrlf)
  514.         #(is,M-x grep of ##(value))
  515.         #(Fcrlf)
  516.     )
  517.     #(M:strings-edit,#(Ffor-all-libs,Mgrep-do,))
  518. ))[*]
  519.  
  520.  
  521. Name:M:mint-indent
  522. [*]#(is,(    ))[*]
  523.  
  524.  
  525. Name:M:mint-newline
  526. Mint mode newline with auto indent, current indent level, and if breaking a
  527. line then indent it a little more.
  528. [*]#(Fcrlf)
  529. #(is,#(Mcurrent-indent)(    ))
  530. #(==,#(rc,$),0,,(#(is,(    ))))[*]
  531.  
  532.  
  533. Name:M:mint-rpar
  534. If we are putting our RPar on a line of code the just flash it, otherwise match
  535. the indenting of the LPar and then flash it.
  536. [*]#(pm,2)
  537. #(lp,[ ##(bc,9,d,a)]*,,x)
  538. #(l?,^,.,0,1)
  539. #(==,##(rm,1),,(
  540.     #(dm,^)#(is,#(Mcurrent-indent))
  541. ))
  542. #(pm)
  543. #(Fflash-paren,(##(bc,40,d,a)),(##(bc,41,d,a)))
  544. [*]
  545.  
  546.  
  547. Name:M:remove-nonexistant
  548. Remove non-existant functions from the documentation file.
  549. [*]
  550. #(lp,N    a    m    e:)
  551. #(pm,1)
  552. #(l?,.,],,0,(
  553.     #(sp,0)
  554.     #(an,##(rm,$))
  555.     #(n?,##(rm,$),(
  556.         #(pm)
  557.         #(SELF)
  558.     ),(
  559.         #(sp,^)
  560.         #(l?,>,],0,,(
  561.             #(dm,0)
  562.         ),(
  563.             #(dm,])
  564.         ))
  565.         #(pm)
  566.     ))
  567. ))
  568. [*]
  569.  
  570.  
  571. Name:M:strings-edit
  572. [*]#(Muse-edit-buffer)
  573. #(sv,mb,##(lv,mb),
  574.     #(Fexit-mode)
  575.     #(es,temp)
  576.     #(ds,temp,##(sa,arg1))
  577.     #(mp,temp,(Farglist,))
  578.     #(Fmultiple,Mstrings-edit-do,##(gs,temp)#(es,temp))
  579.     #(Fenter-local-modes)
  580. )[*]
  581.  
  582.  
  583. Name:M:syntax-edit
  584. Edit the syntax table.
  585. [*]#(Muse-edit-buffer)
  586. #(Msyntax-edit-do,0)
  587. #(rs,Fsyntax)[*]
  588.  
  589.  
  590. Name:M:syntax-read
  591. Read the syntax table back in.
  592. [*]#(sp,[)
  593. #(ds,Fsyntax,#(Msyntax-read-do,0))
  594. #(st,Fsyntax)
  595. #(ds,Fmodified)[*]
  596.  
  597.  
  598. Name:M:trace
  599. This function redefines a function to issue tracing output to a special buffer
  600. called *trace* whenever it is called or returns. The name of the function is
  601. prompted for.
  602. [*]#(ds,value,)
  603. #(Freadline,function to trace: ,(
  604.     #(n?,##(value),(
  605.         #(n?,traced-##(value),(
  606.             #(an,"##(value)" already traced!)
  607.         ),(
  608.             #(ds,traced-##(value),##(gs,##(value),#(Farglist)))
  609.             #(mp,traced-##(value),#(Farglist))
  610.             #(Mtrace-do,##(value),##(gs,##(value),#(Farglist)),##(Farglist))
  611.         ))
  612.     ),(
  613.         #(an,"##(value)" not defined!)
  614.     ))
  615. ))[*]
  616.  
  617.  
  618. Name:M:untrace
  619. This function undoes the effect of M:trace.
  620. [*]#(ds,value,)
  621. #(Freadline,function to untrace: ,(
  622.     #(n?,traced-##(value),(
  623.         #(Muntrace-do,##(value))
  624.     ),(
  625.         #(an,"##(value)" is not traced!)
  626.     ))
  627. ))[*]
  628.  
  629.  
  630. Name:M:untrace-all
  631. This function untraces all functions that have been traced.
  632. [*]
  633. #(Fmultiple,Muntrace-all-do,##(ls,(,),traced-),SELF)
  634. [*]
  635.  
  636.  
  637. Name:M:warn-undefined
  638.     If turned on, give an announcement when a nonexistent function is
  639. activated.  Turned on if (arg1 != ""), else turned off.
  640. [*]    
  641. #(ds,dflta,##(gs,#(==,arg1,,Fdflta,Mdflta),#(Farglist)))
  642. #(mp,dflta,#(Farglist))
  643. [*]
  644.  
  645.  
  646. Name:MOptions-insert
  647. [*]#(bl)[*]
  648.  
  649.  
  650. Name:Mcompare-ed-do
  651. [*]#(Mcompare-read,(
  652.     #(==,##(name),,,(
  653.         #(mp,compare-ed-list,,##(name)(,))
  654.     ))
  655.     #(==,##(gs,##(name),#(Farglist)),##(gs,data,#(Farglist)),(
  656.         #(an,No:  ##(name))
  657.     ),(
  658.         #(an,Yes: ##(name))
  659.         #(Fcrlf)
  660.         #(Fcrlf)
  661.         #(Fcrlf)
  662.         #(is,N    a    m    e:##(name))
  663.         #(Fcrlf)
  664.         #(is,
  665.             #(Mfind-documentation,##(go,name)##(rs,name),##(name))
  666.             #(Mstrings-delimiter)
  667.             #(n?,##(name),(##(gs,##(name),#(Farglist))),***)
  668.             #(Mstrings-delimiter)
  669.         )
  670.         #(Fcrlf)
  671.         #(Fcrlf)
  672.         #(is,Old (.ed file) version of:##(name))
  673.         #(Fcrlf)
  674.         #(is,
  675.             #(Mstrings-delimiter)
  676.             ##(gs,data,#(Farglist))
  677.             #(Mstrings-delimiter)
  678.         )
  679.     ))
  680.     #(SELF)
  681. ))[*]
  682.  
  683.  
  684. Name:Mcompare-read
  685. Define ##(name) and ##(data) to be the name and data of the next string.
  686. [*]#(==,##(rc,]),0,,(
  687.     #(pm,1)
  688.     #(sm,0,.)
  689.     #(Mread-ed,#(Mread-ed-word),#(Mread-ed-word)##(sp,>>>>),#(Mread-ed-word))
  690.     ##(dm,0)
  691.     #(pm)
  692.     arg1
  693. ),(arg2))[*]
  694.  
  695.  
  696. Name:Mcopy-key-do
  697. [*]#(ds,K.arg2,##(K.arg1))[*]
  698.  
  699.  
  700. Name:Mcount-parens-do
  701. [*]#(an,arg1)
  702. #(ds,input,##(gs,arg1,#(Farglist)))
  703. #(ds,temp,##(go,input,end))
  704. #(==,#(SELF-do,#(==,##(temp),end,end,(##(bc,##(temp)))),0),0,,(
  705.     #(an,arg1 mismatched)
  706.     #(is,arg1 mismatched)
  707.     #(Fcrlf)
  708. ))[*]
  709.  
  710.  
  711. Name:Mcount-parens-do-do
  712. [*]#(==,arg1,end,(
  713.     arg2
  714. ),(
  715.     #(ds,temp,##(go,input,end))
  716.     #(SELF,#(==,##(temp),end,end,(##(bc,##(temp)))),
  717.         #(==,arg1,40,(#(++,arg2,1)),(
  718.             #(==,arg1,41,(#(--,arg2,1)),(arg2))
  719.         ))
  720.     )
  721. ))[*]
  722.  
  723.  
  724. Name:Mcref-lib-do
  725. Called with arg1 = a lib letter to cref.
  726. [*]#(Fmultiple,Mcref-one,##(ls,(,),arg1),SELF)[*]
  727.  
  728.  
  729. Name:Mcref-one
  730. Called with the name of a function to cref.
  731. Get rid of syntactic sugar like ( and ) and #( and ##( and comma.
  732. [*]arg1,
  733. #(Ffind-or-make-buffer,*cref*,no)
  734. #(sp,])
  735. #(an,arg1)
  736. #(ds,temp,##(gs,arg1,#(Farglist)))
  737. #(mp,temp,S    E    L    F)
  738. #(ds,temp,##(gs,temp,arg1))
  739. #(mp,temp,(,),(    ),(
  740. ),##    ##(bc,40,d,a),#    ##(bc,40,d,a),##(bc,40,d,a),##(bc,41,d,a))
  741. #(ds,temp,##(gs,temp,(,),(,),(,),(,),(,),(,),(,)))
  742. #(ds,temp,##(sa,#(temp)))
  743. #(Fmultiple,(SELF-do,arg1),##(temp)#(es,temp),SELF)
  744. #(..,#(ba,##(old-buffer)))
  745. [*]
  746.  
  747.  
  748. Name:Mcref-one-do
  749. [*]#(==,arg2,,,(
  750.     #(==,arg2,#(temp),,(
  751.         #(ds,temp,arg2)
  752.         arg2(    )arg1,
  753.     ))
  754. ))[*]
  755.  
  756.  
  757. Name:Mcref-post
  758. [*]#(..)[*]
  759.  
  760.  
  761. Name:Mcref-post-do
  762. [*]abcdasdflkjasdflkjsadflkjasdflkjasdflkjasdflkj[*]
  763.  
  764.  
  765. Name:Mcurrent-indent
  766. Return the indenting of the previous open paren.
  767. [*]#(pm,4)
  768. #(sm,3,[)
  769. #(==,#(Fflash-paren-do,1,(##(bc,40,d,a)),(##(bc,41,d,a))),yes,(
  770.     #(Mget-indent)
  771. ))
  772. #(sp,0)
  773. #(pm)[*]
  774.  
  775.  
  776. Name:Mdebug
  777. Announce a string and wait for a key to be pressed.
  778. [*]#(an,Debug: "arg1")
  779. #(rd)
  780. #(..,##(it,500))
  781. #(an)
  782. [*]
  783.  
  784.  
  785. Name:Mdefun
  786. arg1 is the name of the function.
  787. arg2 is the documentation of the function.
  788. arg3 is the body of the function.
  789. arg4 is the test code for the function.
  790. [*]#(ds,temp,arg1)
  791. #(ds,lib-letter,##(go,temp))
  792. #(mp,lib-list,,##(lib-letter))
  793. #(ds,lib-list,##(lib-list)##(lib-letter))
  794. #(ds,documentation,(arg2))
  795. #(Mstore-documentation,##(lib-letter),arg1)
  796. #(Fisupper,##(bc,##(lib-letter)),(#(ds,##(lib-letter)modified)))
  797. #(ds,arg1,(arg3))
  798. #(mp,arg1,#(Farglist))
  799. arg4
  800. [*]
  801.  
  802.  
  803. Name:Mdflta
  804.     Like Fdflta, except that it gives a warning if the function is 
  805. undefined.
  806.     [wjm 4/1/90] -- BUG: warns only when LIB is undefined, which
  807.                     is to say only for things in libs emacs & key &
  808.                     user.
  809.     [4/4/90] -- above fixed. Also don't complain about Fvisit-hook
  810.             and such.
  811. [*]
  812. #(ds,dflta-n,SELF)
  813. #(ds,dflta-n,##(go,dflta-n))
  814. #(Fisupper,##(bc,##(dflta-n),a,d),(
  815.     #(ds,dflta-n,Fautoload-##(dflta-n))
  816.     #(n?,##(dflta-n),(
  817.         #(an,Autoloading ##(##(dflta-n)))
  818.         #(Fload-lib,##(##(dflta-n)))
  819.     ))
  820.     #(n?,SELF,(
  821. #(gs,SELF,(SELF),(arg1),(arg2),(arg3),(arg4),(arg5),(arg6),(arg7),(arg8),(arg9))
  822.     ),(
  823.         #(==,#(Fright,SELF,5),-hook,,(
  824.                 #(bl)#(an,"SELF" is undefined)#(it,100)
  825.         ))
  826.     ))
  827. ))
  828. [*]
  829.  
  830.  
  831. Name:Mfind-documentation
  832. Return the documentation for a string.
  833. [*]#(Min-documentation,arg1,arg2,(
  834.     ##(rm,0)
  835. ))[*]
  836.  
  837.  
  838. Name:Mget-indent
  839. Return the indenting of the current line.
  840. [*]#(pm,3)
  841. #(lp,[ ##(bc,9,d,a)]*,,R)
  842. #(l?,^,$,0,1)
  843. #(sp,0)
  844. ##(rm,1)
  845. #(sp,2)
  846. #(pm)[*]
  847.  
  848.  
  849. Name:Mgrep-do
  850. Grep the strings in the library whose lib letter is arg1
  851. [*]#(ds,temp,##(ls,(,),arg1))
  852. #(mp,temp,(Farglist,))
  853. #(Fmultiple,Mgrep-do-do,##(gs,temp)#(es,temp))[*]
  854.  
  855.  
  856. Name:Mgrep-do-do
  857. Grep the string named by arg1.
  858. [*]#(ds,temp,arg1)
  859. #(==,##(fm,temp,##(value),!!!),!!!,(
  860.     #(==,##(fm,arg1,##(value),!!!),!!!,,(
  861.         #(rs,arg1)
  862.         arg1(,)
  863.     ))
  864. ),(
  865.     arg1(,)
  866. ))
  867. [*]
  868.  
  869.  
  870. Name:MiK.C-c C-c
  871. [*]M:done-editing[*]
  872.  
  873.  
  874. Name:MiK.C-c [
  875. [*]M:insert-brackets[*]
  876.  
  877.  
  878. Name:MiK.C-c n
  879. [*]M:insert-name[*]
  880.  
  881.  
  882. Name:MiK.C-i
  883. [*]M:mint-indent[*]
  884.  
  885.  
  886. Name:MiK.C-j
  887. [*]M:mint-newline[*]
  888.  
  889.  
  890. Name:MiK.M-C-i
  891. [*]M:mint-expand[*]
  892.  
  893.  
  894. Name:MiK.M-Tab
  895. [*]M:mint-expand[*]
  896.  
  897.  
  898. Name:MiK.RPar
  899. [*]M:mint-rpar[*]
  900.  
  901.  
  902. Name:MiK.Tab
  903. [*]M:mint-indent[*]
  904.  
  905.  
  906. Name:Min-documentation
  907. Locate the documentation for the function arg2 in the library arg1.
  908. Execute arg3 if the documentation exists [with point just before the
  909. string-delimiter, and mark 0 just after the Name:.], otherwise execute
  910. arg4 if the documentation doesn't exist.
  911. [*]
  912. #(ds,old-buffer,##(ba,-1))
  913. #(n?,buffer-name.##(arg1filename).edd,(
  914.     #(..,#(ba,##(buffer-name.##(arg1filename).edd)))
  915. ),(
  916.     #(ds,value,##(env.EMACS)##(arg1filename).edd)
  917.     #(Ffind-buffer,##(arg1filename).edd,,,(
  918.         #(Ffind-unused-buffer,##(value))
  919.         #(==,##(ff,##(value)),,(
  920.             #(Fbuffer-set-fn,##(value))
  921.         ),(
  922.             #(Fvisit-do)
  923.         ))
  924.         #(Fremember-buffer,bury)
  925.     ))
  926. ))
  927. #(lp,N    a    m    e:arg2)
  928. #(pm,1)
  929. #(l?,[,],,0,(
  930.     #(sp,0>)
  931.     #(lp,#(Mstrings-delimiter))
  932.     #(l?,.,],0)
  933.     arg3
  934. ),(
  935.     arg4
  936. ))
  937. #(pm)
  938. #(..,#(ba,##(old-buffer)))
  939. [*]
  940.  
  941.  
  942. Name:Mint-cmd
  943. This is used to define the string #(d), which executes keys.
  944. [*]#(ds,result,
  945. #(#(hk,MiK.arg1,K.arg1,Fself-insert,arg1))
  946. )[*]
  947.  
  948.  
  949. Name:Mkeys-edit-do
  950. [*]#(an,arg1)
  951. #(ds,temp,arg1)
  952. #(..,##(gn,temp,2))
  953. #(is,##(temp))
  954. #(Fpad-to-column,17)
  955. #(ds,temp,##(arg1))
  956. #(is,is ##(temp))
  957. #(Fcrlf)[*]
  958.  
  959.  
  960. Name:Mkeys-read-do
  961. [*]#(sv,cs,17)
  962. #(==,##(rm,>)##(sp,>)##(rm,>)#(sp,>)##(rm,>)#(sp,<<),is ,(
  963.     #(ds,temp,##(rm,^))
  964.     #(sp,>>>)
  965.     #(mp,temp,,(    ))
  966.     #(an,##(temp))
  967.     #(ds,K.##(temp),##(rm,$))
  968.     #(sp,$>)
  969.     #(SELF)
  970. ),(
  971.     #(sp,$>)
  972.     #(==,##(rm,>),,,(#(SELF)))
  973. ))[*]
  974.  
  975.  
  976. Name:Mread-ed
  977. Read a .ED file.  Return ##(name) and ##(data).  Dependent upon the format
  978. of .ED files.
  979. [*]#(ds,name,#(SELF-chars,arg2))
  980. #(ds,data,#(SELF-chars,arg3))
  981. #(..,#(SELF-chars,#(--,arg1,#(++,#(++,arg2,arg3),10))))
  982. [*]
  983.  
  984.  
  985. Name:Mread-ed-chars
  986. Given a character count, read that many chars out of the buffer and
  987. advance point.
  988. [*]#(g?,arg1,0,(
  989.     ##(rm,>)
  990.     #(==,##(rm,>),(
  991. ),(
  992.         ##(sp,>)
  993.         #(SELF,#(--,arg1,2))
  994.     ),(
  995.         ##(sp,>)
  996.         #(SELF,#(--,arg1,1))
  997.     ))
  998. ))[*]
  999.  
  1000.  
  1001. Name:Mread-ed-word
  1002. Return a word from the two chars following point.
  1003. [*]##(++,##(bc,##(rm,>)##(sp,>)),##(**,256,##(bc,##(rm,>)##(sp,>))))[*]
  1004.  
  1005.  
  1006. Name:Mstore-documentation
  1007. [*]#(Min-documentation,arg1,arg2,(
  1008.     #(==,##(documentation),,(
  1009.         #(dm,0)
  1010.         #(dm,$)
  1011.         #(dm,<)
  1012.         #(dm,^)
  1013.         #(dm,>)
  1014.         #(dm,>)
  1015.     ),(
  1016.         #(==,##(documentation),##(rm,0),,(
  1017.             ##(dm,0)
  1018.             #(is,##(documentation))
  1019.         ))
  1020.     ))
  1021. ),(
  1022.     #(==,##(documentation),,,(
  1023.         #(sp,])
  1024.         #(Fcrlf)
  1025.         #(sm,0,<)
  1026.         #(Fcrlf)
  1027.         #(is,N    a    m    e:arg2)
  1028.         #(Fcrlf)
  1029.         #(is,##(documentation)#(Mstrings-delimiter))
  1030.     ))
  1031. ))
  1032. #(es,documentation)
  1033. [*]
  1034.  
  1035.  
  1036. Name:Mstrings-delimiter
  1037. Returns the string delimiter for Mstrings-read and M:strings-edit.
  1038. [*]##(bc,91,d,a)##(bc,42,d,a)##(bc,93,d,a)[*]
  1039.  
  1040.  
  1041. Name:Mstrings-edit-do
  1042. Insert one string into the buffer for editing, unless it's already there.
  1043. [*]#(lp,^N    a    m    e:#(Fregexp-quote,arg1)$,,r)
  1044. #(l?,[,],,0,(
  1045.     #(an,arg1 is already loaded)
  1046. ),(
  1047.     #(SELF-do,arg1)
  1048. ))[*]
  1049.  
  1050.  
  1051. Name:Mstrings-edit-do-do
  1052.     Args:(cmd-name)
  1053. Insert one string into the buffer for editing.
  1054.     Modified (WJM): parallel to the above changes for M:done-editing,
  1055.         I changed this so that M:ef will recognize the Arg: line
  1056.         in the documentation and use those arguments.
  1057.        (3/11) fixed my bug: had #(rm,0) instead of ##(rm,0) when looking
  1058.         for 'Args:'.  This raised hell when there was no Arg1, but 
  1059.         '#(Fmu)' instead.
  1060.  
  1061. [*]
  1062. #(pm,2)
  1063. #(an,[arg1])
  1064. #(Fcrlf)
  1065. #(Fcrlf)
  1066. #(Fcrlf)
  1067. #(is,Name:arg1)
  1068. #(Fcrlf)
  1069. #(sm,0,<)
  1070. #(ds,temp,arg1)
  1071. #(is,
  1072.     #(Mfind-documentation,##(go,temp),arg1)
  1073.     #(Fexit-mode)
  1074.     #(Mstrings-delimiter)
  1075. )
  1076. #(sp,0>)
  1077. #(sp,>>>>>)
  1078. #(==,##(rm,^),Args:,(
  1079.     #(sp,>)#(sm,0)#(sp,$<)
  1080.     #(is,##(gs,arg1,SE    LF,#(rm,0)#(sp,])))
  1081. ),(
  1082.     #(sp,])
  1083.     #(is,##(gs,arg1,#(Farglist)))
  1084. ))
  1085. #(is,#(Mstrings-delimiter))
  1086. #(pm)
  1087. #(es,temp)
  1088. [*]
  1089.  
  1090.  
  1091. Name:Mstrings-read
  1092. Read all the strings out of the text buffer.
  1093.     WJM: modifications --
  1094.         Looks for "Name:" only at start of line.
  1095.         New keyword "Args:".  If this is given on the second
  1096.             line, following the line with "Name:",
  1097.             followed by a paranthesised argument list then
  1098.             those argument names are used instead of
  1099.             "arg1,arg2,...".
  1100. arg1 is non-empty if the documentation should not be read.
  1101. [*]#(pm,2)
  1102. #(lp,(
  1103. )Name:)
  1104. #(l?,.,],,0,(
  1105.     #(sp,0$>>>>>>)
  1106.     #(ds,arglist,##(Farglist))
  1107.     #(==,##(rm,^),Args:,(
  1108.         #(sp,>)#(sm,1)#(sp,$<)
  1109.         #(ds,arglist,SEL(F,)##(rm,1))
  1110.     ))
  1111.     #(sp,0)
  1112.     #(pm)
  1113.     #(SELF-do,##(rm,>),#(rm,$),arg1)
  1114.     #(Fbreak,,(
  1115.         #(SELF,arg1)
  1116.     ))
  1117. ),(
  1118.     #(an)
  1119.     #(pm)
  1120. ))[*]
  1121.  
  1122.  
  1123. Name:Mstrings-read-do
  1124. Read the string arg2 out of the text buffer.  The string belongs in the library
  1125. whose lib letter is arg1.  Note that this function will autoload libraries
  1126. that are autoloadable.
  1127. arg3 is non-empty if the documentation should not be read.
  1128. [*]#(an, [Reading arg2])
  1129. #(Fand,(Fand,(Fisupper,##(bc,arg1)),(==,#(arg1filename),,)),(!=,arg2,arg1filename,,),(
  1130.     #(Ferror,You should define arg1filename first, or else load the library)
  1131. ),(
  1132.     #(mp,lib-list,,arg1)
  1133.     #(ds,lib-list,arg1##(lib-list))
  1134. ))
  1135. #(sp,$>)
  1136. #(pm,3)
  1137. #(lp,#(Mstrings-delimiter))
  1138. #(l?,.,],0,1)
  1139. #(sp,1)
  1140. #(l?,1,],1)
  1141. #(ds,temp,##(rm,1))
  1142. #(sp,1)
  1143. #(==,##(temp),***,(
  1144.     #(n?,arg2,(
  1145.         #(es,arg2)
  1146.         #(Fisupper,##(bc,arg1),(#(ds,arg1modified)))
  1147.     ))
  1148. ),(
  1149.     #(==,##(temp),##(gs,arg2,#(arglist)),(
  1150.         #(n?,arg2,,(
  1151.             #(ds,arg2)
  1152.             #(Fisupper,##(bc,arg1),(#(ds,arg1modified)))
  1153.         ))
  1154.     ),(
  1155.         #(Fisupper,##(bc,arg1),(#(ds,arg1modified)))
  1156.         #(ds,arg2,##(temp))
  1157.         #(mp,arg2,#(arglist))
  1158.     ))
  1159. ))
  1160. #(==,arg3,,(
  1161.     #(sp,2)
  1162.     #(ds,documentation,##(rm,0))
  1163.     #(Fisupper,##(bc,arg1),(
  1164.         #(Mstore-documentation,arg1,arg2)
  1165.         #(Fexit-mode)
  1166.     ))
  1167. ))
  1168. #(sp,1)
  1169. #(pm)
  1170. [*]
  1171.  
  1172.  
  1173. Name:Msyntax-edit-do
  1174. [*]#(g?,arg1,255,,(
  1175.     #(an,Inserting "##(bc,arg1,d,a)")
  1176.     #(is,##(bc,arg1,d,a))
  1177.     #(ds,temp,##(bc,##(++,##(bc,##(go,Fsyntax),a,d),512),d,b))
  1178.     #(..,##(go,temp))
  1179.     #(is,##(temp))
  1180.     #(Fcrlf)
  1181.     #(SELF,##(++,arg1,1))
  1182. ))
  1183. [*]
  1184.  
  1185.  
  1186. Name:Msyntax-read-do
  1187. [*]#(g?,arg1,255,,(
  1188.     #(an,Reading "##(bc,arg1,d,a)")
  1189.     #(==,##(rm,>),##(bc,arg1,d,a),(
  1190.         #(sp,>)
  1191.         ##(bc,##(rm,$),b,a)
  1192.         #(sp,$>)
  1193.         #(SELF,##(++,arg1,1))
  1194.     ),(
  1195.         #(an,"##(bc,arg1,d,a)" doesn't match up)
  1196.     ))
  1197. ))
  1198. [*]
  1199.  
  1200.  
  1201. Name:Mt
  1202. ace-do
  1203. Redefine a string such that it inserts its invocation and its result.
  1204.   arg1 = name of string to redefine.
  1205.   arg2 = value of string.
  1206.   arg3 = arglist.
  1207. [*]arg1,arg2,arg3[*]
  1208.  
  1209.  
  1210. Name:Mtrace-append-line
  1211. [*]#(ds,old-old-buffer,##(old-buffer))
  1212. #(==,##(trace-buffer),,(
  1213.     #(Ffind-or-make-buffer,*trace*)
  1214.     #(ds,trace-buffer,##(ba,-1))
  1215. ),(
  1216.     #(ds,old-buffer,##(ba,-1))
  1217.     #(..,#(ba,##(trace-buffer)))
  1218. ))
  1219. #(sp,])
  1220. #(is,(arg1arg2arg3
  1221. ))
  1222. #(..,#(ba,##(old-buffer)))
  1223. #(ds,old-buffer,##(old-old-buffer))
  1224. (arg2)
  1225. [*]
  1226.  
  1227.  
  1228. Name:Mtrace-do
  1229. Redefine a string such that it inserts its invocation and its result.
  1230.   arg1 = name of string to redefine.
  1231.   arg2 = value of string.
  1232.   arg3 = arglist.
  1233. [*]#(ds,(arg1),
  1234.     #(==,##(go,(arg1))#(rs,(arg1)),(    ),((    
  1235. )),)
  1236.     (
  1237.     #(Mtrace-append-line,##(trace-indent)((arg3)),,)
  1238.     #(Mtrace-append-line,##(trace-indent)[,
  1239.         #(ds,trace-indent,##(trace-indent)( ))
  1240.         arg2
  1241.         #(ds,trace-indent,
  1242.             ##(gn,trace-indent,#(--,#(nc,##(trace-indent)),1))
  1243.             #(rs,trace-indent)
  1244.         )
  1245.     ,])
  1246. ))
  1247. #(mp,(arg1),#(Farglist))
  1248. [*]
  1249.  
  1250.  
  1251. Name:Muntrace-all-do
  1252. [*]
  1253. #(ds,temp,(arg1))
  1254. #(mp,temp,traced-)
  1255. #(Muntrace-do,#(gs,temp))
  1256. [*]
  1257.  
  1258.  
  1259. Name:Muntrace-do
  1260. [*]
  1261. #(ds,(arg1),##(gs,traced-(arg1),#(Farglist)))
  1262. #(mp,(arg1),#(Farglist))
  1263. #(es,traced-(arg1))
  1264. [*]
  1265.  
  1266.  
  1267. Name:Muse-edit-buffer
  1268. [*]#(Fremember-buffer)
  1269. #(Ffind-or-make-buffer,*mint-edit*,n)
  1270. #(M!Mint-mode)
  1271. #(sp,])
  1272. [*]
  1273.  
  1274.  
  1275. Name:Fautoload-M
  1276. [*]minted[*]
  1277.  
  1278.  
  1279. Name:K.M-Escape
  1280. [*]M:eval-expression[*]
  1281.  
  1282.  
  1283. Name:K.M-C-[
  1284. [*]M:execute-buffer[*]
  1285.  
  1286.  
  1287. Name:K.C-x C-e
  1288. [*]M:eval-last-sexp[*]
  1289.  
  1290.  
  1291.